﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using Entities.Admin;

namespace WindowsForms.Admin
{
    public partial class FormKetQuaGiaiDau : Form
    {
        int magiaidau;
        public FormKetQuaGiaiDau()
        {
            InitializeComponent();
            dataGridViewGD.AutoGenerateColumns = false;
        }

        private void FormKetQuaGiaiDau_Load(object sender, EventArgs e)
        {
            dataGridViewGD.DataSource = GiaiDau.Objects.All().OrderByDescending(x=>x.ThoiGianBatDau).Skip(0).Take(3).ToList();
        }

     

     

        private void dataGridViewGD_CellContentClick_1(object sender, DataGridViewCellEventArgs e)
        {
            if (e.ColumnIndex == 3)
            {
                magiaidau = Convert.ToInt32(dataGridViewGD[0, e.RowIndex].Value);
                 FormDoiTuyen.magiaidau = magiaidau;
            FormDoiTuyen fr = new FormDoiTuyen();
            fr.ShowDialog();

            }
          
        }

        private void thoátToolStripMenuItem_Click(object sender, EventArgs e)
        {
            this.Close();
        }
    }
}
